<template>
  <div>
    <h1>B</h1>
    <button @click="giveInfo">将info给A</button>
  </div>
</template>

<script setup>
import emitter from "../plugins/Bus.js";
const info = ref("你们猜孙伟在不在？？？");
// 将info传递给A组件 完成兄弟传值
const giveInfo = () => {
  emitter.emit("getInfo", info);
};
</script>

<style lang="scss" scoped>
</style>